#! /usr/bin/python
#
# Stephen Poletto (spoletto)
# Peter Wilmot (pbwilmot)
# CSCI1580 - Web Search
# Spring 2011 - Brown University
#
# Run queryIndex and diff again
# TA expected solution.

import sys, os

if (len(sys.argv) != 2):
    print ""
    print "usage: testQuery <queryname (e.g. OWQ)>"
    print ""
    sys.exit()
    
print "./queryIndex.sh stopWords.dat /ltmp/index1.dat /ltmp/titleindex1.dat < /course/cs158/data/part2/queries/" + sys.argv[1] + " > our" + sys.argv[1] + "results"
os.system("./queryIndex.sh stopWords.dat /ltmp/index1.dat /ltmp/titleindex1.dat < /course/cs158/data/part2/queries/" + sys.argv[1] + " > our" + sys.argv[1] + "results")
print "vimdiff /course/cs158/data/part2/queries/" + sys.argv[1] + "_expected_fullCollection our" + sys.argv[1] + "results"
os.system("vimdiff /course/cs158/data/part2/queries/" + sys.argv[1] + "_expected_fullCollection our" + sys.argv[1] + "results")